﻿Imports DAO
Imports DTO
Public Class SachBUS
    Public Shared Function SoLuongTon(ByVal PhieuNhap As PHieuNhapSach) As Double
        Dim kq As Double

        kq = SachDAO.SoLuongTon(PhieuNhap)
        Return kq
    End Function
    Public Shared Function LuuBangSach(ByVal TenSach As String, ByVal MaTheLoai As String, ByVal TacGia As String, ByVal Giasach As Double, ByVal SoLuong As Double, ByVal ngayNhap As DateTime) As Integer
        Dim DAO As SachDAO = New SachDAO()
        Return DAO.LuuBangSach(TenSach, MaTheLoai, TacGia, Giasach, SoLuong, ngayNhap)

    End Function
    Public Shared Function LayTenSach() As List(Of BangSachDTO)
        Dim BangSach As List(Of BangSachDTO) = New List(Of BangSachDTO)
        BangSach = SachDAO.LayTenSach()
        Return BangSach
    End Function
    Public Shared Function LayBangSach() As DataTable
        Return SachDAO.LayBangSach()
    End Function
    ' truyen vao ten sach va the loai lay ra gia sach
    Public Shared Function LayGiaSach(ByVal TenSach As String, ByVal TenTheLoai As Integer) As List(Of BangSachDTO)
        Dim BangSach As List(Of BangSachDTO) = New List(Of BangSachDTO)
        BangSach = SachDAO.LayGiaSach(TenSach, TenTheLoai)
        Return BangSach
    End Function
End Class
